#include "resumer.h"

/**************** Receiver part of the gateway   ********************/


/************* Faster resume to the poller in case a  message arrives **/


Resumer::Resumer() {
	ownerGateway = 0;
}

void Resumer::setOwner(Gateway* ownerGateway_) {
	this->ownerGateway = ownerGateway_;
	this->linkinterface2 = ownerGateway->linkinterface;
}

void Resumer::handle() {
	if(ownerGateway == 0) return;
	if(linkinterface2->isNetworkMsgReadyToRead())
		ownerGateway->networkReader.resume();
}
void Resumer::init()   { activatePeriodic(1*SECONDS, 10*MILLISECONDS); }

